<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="commons/taglibs.jsp" %>
<!DOCTYPE html>
<!-- saved from url=(0026)http://sell.fqapps.com/reg -->
<html class="js cssanimations"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <title>重置密码-一折微信淘客系统</title>

    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/amazeui.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/admin.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/style.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/assets/css/login.css"/>

    <!--[if (gte IE 9)|!(IE)]><!-->
    <script type="text/javascript" src="${ctx}/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctx}/assets/js/fastclick.min.js"></script>
    <script>$(function() {FastClick.attach(document.body);});</script>
    <!--<![endif]-->

    <script type="text/javascript" src="${ctx}/assets/js/amazeui.min.js"></script>
</head>

<%@ include file="commons/dialog.jsp" %>
<script>

$(function() {
	
	$('#authcodeimg').attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());

    $('#authcodeimg').on('click', function() {
        $(this).attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());
    });
	
	$('#verifyCode').keypress(function(event){  
		var keycode = (event.keyCode ? event.keyCode : event.which);  
		if(keycode == '13'){  
			$('#submit').click();
		}
	});
	
	$('#sendsms').on('click', function() {
	
		var mobile = $('#mobile').val();
		var verifyCode = $('#verifyCode').val();
		
		if(mobile == ""){
			$("#fq_alert_info").html("手机号不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		if(verifyCode == ""){
			$("#fq_alert_info").html("验证码不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		$.post("${ctx}/user/sendSms.do",{mobile:mobile,verifyCode:verifyCode},function(result){
            if(result.code == 200){
                $("#sendsms").text('已发送');
                $("#sendsms").attr("disabled","disabled");
            }else{
                $("#fq_alert_info").html(result.message);
                $('#fq_alert').modal({closeViaDimmer:false});
                if(result.code == 0){
                    $('#verifyCode').val("");
                    $('#authcodeimg').attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());
                }
            }
        });
	
	});

	$('#submit').on('click', function() {
	
		var mobile = $('#mobile').val();
		var password = $('#password').val();
		var repassword = $('#repassword').val();
		var smsCode = $('#smsCode').val();
		var verifyCode = $('#verifyCode').val();
		var __hash__ = $("input[name='__hash__']").val();
		
		if(mobile == ""){
			$("#fq_alert_info").html("手机号不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		if(verifyCode == ""){
            $("#fq_alert_info").html("验证码不能为空！");
            $('#fq_alert').modal({});
            return
        }
		
		if(smsCode == ""){
			$("#fq_alert_info").html("短信验证码不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		if(password == "" || repassword == ""){
			$("#fq_alert_info").html("密码不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		if(repassword != password){
			$("#fq_alert_info").html("两次输入密码不同！");
			$('#fq_alert').modal({});
			return
		}
		
		$.post("${ctx}/user/resetPassword.do",{mobile:mobile,password:password,smsCode:smsCode,verifyCode:verifyCode},function(result){
				if(result.code == 200){
					$("#fq_confirm_info").text(result.message);
					$('#fq_confirm').modal({closeViaDimmer:false,relatedTarget: this,onConfirm: function(options) {
							window.location.href="${ctx}/user/loginPage.do"; 
						},onCancel: function() {}
					});
				}else{
					$("#fq_alert_info").html(result.message);
					$('#fq_alert').modal({closeViaDimmer:false});
				}
		});
	});
	
});

</script>

<header class="sso_header">
	<a href="http://www.fqapps.com" class="logo"></a>
</header>


<body>

<section class="content_box">

<div class="am-form am-form-horizontal"  method="post" data-am-validator>
	
	<div class="am-form-group">
		<div class="am-u-sm-12">
			<input type="number"  placeholder="输入您的手机" id="mobile" required>
		</div>
	</div>
	
	<div class="am-form-group">
		<div class="am-u-sm-8">
		<input type="text"  placeholder="输入验证码" id="verifyCode" required>
		</div>
		<div class="am-u-sm-4 am-padding-left-0">
		<img class="authcodeimg" id="authcodeimg" src="" style="cursor: pointer;">
		</div>
	</div>
	
	<div class="am-form-group">
		<div class="am-u-sm-8">
		<input type="text"  placeholder="短信验证码" id="smsCode" required>
		</div>
		<div class="am-u-sm-4 am-padding-left-0">
		<button id="sendsms" class="am-btn am-btn-success am-btn-block am-text-xs" style="line-height: 23px;">获取验证码</button>
		</div>
	</div>

	
	<div class="am-form-group">
		<div class="am-u-sm-12">
			<input type="password"  placeholder="设置新的密码" id="password" required>
		</div>
	</div>
  
	<div class="am-form-group">
		<div class="am-u-sm-12">
			<input type="password"  placeholder="重复新的密码" id="repassword" required>
		</div>
	</div>
  
	

	<div class="am-form-group">
		<div class="am-u-sm-12 ">
		<button id="submit" class="am-btn am-btn-primary am-btn-block">重置密码</button>
		</div>
	</div>
  
	<h5 class="reg_now">已有帐号？<a href="${ctx}/user/loginPage.do">立即登陆</a></h5>
  
</div>

</section>

<footer>
	<div class="slogan">— 微信淘客盈利助手 —</div>
	<div style="color: #d1d1d1;" class="am-text-sm am-margin-top-xs am-text-center">深圳前海刷云科技有限公司  CopyRight©2016  闽ICP备16026055号</div>
</footer>

</body>

<div class="am-hide"><script src="//s4.cnzz.com/z_stat.php?id=1259014359&web_id=1259014359" language="JavaScript"></script></div>					
</html>